import os

__author__ = 'andrey'

class FileNotFoundError(Exception):
    def __init__(self, filename):
        self.filename = filename

    def __str__(self):
        return 'file not found: ' + self.filename


class File(object):

    database = ''

    def __init__(self, filename):
        self.filename = filename.lower()
        self.full_name = os.path.expanduser(os.path.join(self.database, self.filename[0], self.filename))
        if not os.path.exists(self.full_name):
            raise FileNotFoundError(self.full_name)

    def _read(self):
        if hasattr(self, '_data'):
            return
        with open(self.full_name) as df:
            self._data = df.read()

